package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @program: cloud2020
 * @description: TODO
 * @author: YuWenYi
 * @create: 2021-04-14 21:06
 **/
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")  //找这个微服务下面的方法去处理请求
public interface PaymentFeignService {

    //在上面指定的微服务下找到请求路径为下面的方法!
    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "/payment/feign/timeout")
    String paymentFeignTimeout();

}
